package com.app.bimo.commonbusiness.util;

import android.content.Context;

/**
 * 用于引导弹窗存储状态
 */
public class LeadManager {

    public static final String SHARED_LEAD_PREFERENCES = "shared_lead_preferences";

    private static volatile LeadManager sInstance;

    private SharedPreUtils sharedPreUtils;

    public static LeadManager getInstance(Context context) {
        if (sInstance == null) {
            synchronized (LeadManager.class) {
                if (sInstance == null) {
                    sInstance = new LeadManager(context);
                }
            }
        }
        return sInstance;
    }

    private LeadManager(Context context) {
        sharedPreUtils = SharedPreUtils.getInstance(context);
    }

    /**
     * 是否已经展示过偏好设置
     *
     * @param isShowed
     */
    public void setPreferences(boolean isShowed) {
        sharedPreUtils.putBoolean(SHARED_LEAD_PREFERENCES, isShowed);
    }

    public boolean getPreferences() {
        return sharedPreUtils.getBoolean(SHARED_LEAD_PREFERENCES, false);
    }
}
